﻿<UserControl x:Class="MartinCarolan.EventSpy.UI.ObjectExplorer"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:ui="clr-namespace:MartinCarolan.EventSpy.UI"
             xmlns:conv="clr-namespace:MartinCarolan.EventSpy.UI.Converters"
             mc:Ignorable="d">
    <UserControl.Resources>
        <conv:PropertyTypeToImageConverter x:Key="propertyImageConverter" />
    </UserControl.Resources>
        <DataGrid Name="_grid" MouseUp="MouseUp" MouseRightButtonUp="MouseRightButtonUp" GridLinesVisibility="None" IsReadOnly="True"
                  CanUserAddRows="False" CanUserDeleteRows="False" CanUserReorderColumns="True"
                  CanUserResizeColumns="True" CanUserSortColumns="True"
                  AutoGenerateColumns="False">
            <DataGrid.HorizontalGridLinesBrush>
                <SolidColorBrush Color="{DynamicResource {x:Static SystemColors.ControlDarkColorKey}}"/>
            </DataGrid.HorizontalGridLinesBrush>
            <DataGrid.Columns>
                <DataGridTemplateColumn Width="16">
                    <DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <Image Margin="2" Source="{Binding Path=IsField, Converter={StaticResource propertyImageConverter}}" />
                        </DataTemplate>
                    </DataGridTemplateColumn.CellTemplate>
                </DataGridTemplateColumn>
                <DataGridTextColumn Header="Name" Binding="{Binding Path=Name}" Width="270" />
                <DataGridTextColumn Header="Value" Binding="{Binding Path=Value}" Width="270" />
                <DataGridTextColumn Header="Type" Binding="{Binding Path=FieldType}" Width="270" />
            </DataGrid.Columns>
        </DataGrid>
</UserControl>
